{% extends 'templates/default_template.html' %}
{%block content%}
<h1>Project {{project.name}} #{{project.key.id}}</h1>
<p>Leader: {{project.leader.name}}</p>
<hr />

<h2>Project details</h2>
<p>Default origin: {{project.default_origin}}</p>
<p>Default destination: {{project.default_destination}}</p>

<h2>Project Members</h2>
<div>
{% if project.members%}
  <ul class="memberList">
  {% for member in members %}
    <li><a href="/users/{{member.key}}">{{member.name}} {%ifequal member.key logged_user.key%}(You){%endifequal%}</a></li>
  {% endfor %}
  </ul>
{% else %}
<p>Project has no members</p>
{%endif%}
<h2>Project Options</h2>
<div class="projectOptions">
  {% if can_add_members %}
  <div class="fastOption">
    <h3>Add member to project</h3> 
    <p>At this moment, you can try to add repeated employees, but it won't work</p>
    <form action="/projects/{{project.key}}/add_member" method="post">
      <select name="member_key">
	{% for member in project.company.employees %}
	<option value="{{member.key}}">{{member.name}}</option>
	{% endfor%}
      </select>
      <input type="submit" />
    </form>
  </div>
  {% endif%}
</div>
</div>
{%endblock content%}